﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ESPlus.Application.Chat.Passive;
using ESBasic.ObjectManagement.Forms;
using ESPlus.Application.Chat;

namespace ESFDemo.Forms
{
    public partial class ChatForm : Form, IManagedForm<string>
    {
        private string friendID;

        public ChatForm(string currentUserID,string _friendID ,IChatOutter chatOutter)
        {
            InitializeComponent();

            this.friendID = _friendID;
            this.textChatControl1.Initialize(currentUserID, _friendID, chatOutter);

            this.Text = string.Format("正在与{0}对话中...", _friendID);
        }

        #region IManagedForm<string> 成员

        public string FormID
        {
            get { return this.friendID; }
        }

        #endregion

        public void ShowOtherTextChat(string userID, TextChatContract contract)
        {
            this.textChatControl1.ShowOtherTextChat(userID, contract);
        }

        public void SelfOrFriendOffline()
        {
            this.textChatControl1.Enabled = false;
            this.Text += "     已经掉线" ;
        }

    }
}
